jQuery(function() {
  /*adding the last class to the last node on the page*/
  jQuery('.nodes').find('.node').last().addClass('last');

  /*adding an event for code link click event*/
  jQuery('.page-event').click(function() {
    var eventCategory = jQuery(this).attr('data-category');
    var eventAction = jQuery(this).attr('data-action');
    var eventLabel = window.document.title;
    _gaq.push(['_trackEvent', eventCategory, eventAction, eventLabel]);
  });
});

var twitterBlock = false;
$(window).scroll(function() {
  if (twitterBlock == false) {
    $.ajax({
      url: base_url + 'ajax/get_twit_block',
      async: false,
      type: "POST",
      dataType: "html",
      success: function(data) {
        $('#twit-block-container').html(data);
        twitterBlock = true;
      }
    });
  }
});
